package com.xmut.rc.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @description: SysPermission对象
 * @author: XS
 * @date: 2022/5/23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("rc_sys_permission")
@ApiModel(value="SysPermission对象", description="")
public class SysPermission implements Serializable {

    private static final long serialVersionUID = 1L;

    @Excel(name = "权限id")
    @ApiModelProperty(value = "权限id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Excel(name = "父级id")
    @ApiModelProperty(value = "父级id")
    private String parentId;

    @Excel(name = "菜单标题")
    @ApiModelProperty(value = "菜单标题")
    private String name;

    @Excel(name = "路径")
    @ApiModelProperty(value = "路径")
    private String path;

    @Excel(name = "组件")
    @ApiModelProperty(value = "组件")
    private String component;

    @Excel(name = "组件名称")
    @ApiModelProperty(value = "组件名称")
    private String componentName;

    @Excel(name = "一级菜单跳转地址")
    @ApiModelProperty(value = "一级菜单跳转地址")
    private String redirect;

    @ApiModelProperty(value = "菜单类型(0:一级菜单; 1:子菜单:2:按钮权限)")
    private Integer menuType;

    @Excel(name = "菜单图标")
    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
    private Integer idDelete;

    @Excel(name = "创建日期",format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建日期")
    private Date gmtCreate;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新日期")
    private Date gmtModified;


    @ApiModelProperty(value = "层级")
    @TableField(exist = false)
    private Integer level;

    @ApiModelProperty(value = "下级")
    @TableField(exist = false)
    private List<SysPermission> children;

    @ApiModelProperty(value = "是否选中")
    @TableField(exist = false)
    private boolean isSelect;
}
